package br.com.locadoraweb.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import br.com.locadoraweb.bean.Filme;

public class FilmeDAO {
	public void SQL_INSERT_Filme(Filme objInsert) throws SQLException {
		Connection c = null;
        c = Conexao.getConexao();
		PreparedStatement stmt = null;
		stmt = c.prepareStatement("INSERT INTO tbl_filme (nome, descricao, preco, situacao, duracao, genero) VALUES (?, ?, ?, ?, ?, ?)");
	    stmt.setString(1, objInsert.getNome());
	    stmt.setString(2, objInsert.getDescricao());
	    stmt.setDouble(3, objInsert.getPreco());
	    stmt.setString(4, objInsert.getSituacao());
	    stmt.setInt   (5, objInsert.getDuracao());
	    stmt.setInt   (6, objInsert.getGenero());
	    stmt.execute();
	    stmt.close();                       
	}
}
